#include "mainwindow.h"
#include <QApplication>
#include <QWidget>
#include <QLabel>
#include <QTranslator>
#include <QMessageBox>
#include <QPushButton>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setApplicationName("TestQt");
    a.setApplicationVersion("0.1.2");
    /*
    CQStringList args = a.arguments();
    foreach(QString ag, args)
    {
        QMessageBox::information(0,"message",qPrintable(ag));
    }
    if(args.contains("-cn"))
    {
        QMessageBox::information(0,"message","-cn");
    }
    //*/
    QTranslator translator;
    if(translator.load("testQt_zh_CN.qm"))
        a.installTranslator(&translator);
    else if(translator.load("..\\testQt_zh_CN.qm"))
        a.installTranslator(&translator);

    MainWindow w;
    w.show();

    /*
    QPushButton button("Quit");
    QObject::connect(&button, &QPushButton::clicked, &QApplication::quit);
    QObject::connect(&button, &QPushButton::clicked, [](bool) {
        qDebug() << "You clicked me!";
    });//use Lambda
    button.show();
    //*/

    return a.exec();
}
